import 'package:hm_show_flutter/entity/company.dart';

class CompanyEntity {
	int errno;
	CompanyData data;
	String errmsg;

	CompanyEntity({this.errno, this.data, this.errmsg});

	CompanyEntity.fromJson(Map<String, dynamic> json) {
		errno = json['errno'];
		data = json['data'] != null ? new CompanyData.fromJson(json['data']) : null;
		errmsg = json['errmsg'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['errno'] = this.errno;
		if (this.data != null) {
      data['data'] = this.data.toJson();
    }
		data['errmsg'] = this.errmsg;
		return data;
	}
}

class CompanyData {
	List<CompanyModel> companyList;
	String company;

	CompanyData({this.companyList, this.company});

	CompanyData.fromJson(Map<String, dynamic> json) {
		if (json['companyList'] != null) {
			companyList = new List<CompanyModel>();(json['companyList'] as List).forEach((v) { companyList.add(new CompanyModel.fromJson(v)); });
		}
		company = json['company'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.companyList != null) {
      data['companyList'] =  this.companyList.map((v) => v.toJson()).toList();
    }
		data['company'] = this.company;
		return data;
	}
}
